package cate.game.role.res.guild.msg.basic;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdGuild;
import cate.game.role.Role;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "重置入会申请条件 的 请求")
public class ResetAuthenticationReq implements MsgInput {

    @NoteField(value = "验证设置")
    public boolean authentication;

    @NoteField(value = "入会等级要求")
    public int levelRequired;

    @NoteField(value = "入会战力要求")
    public long PowerRequired;

    public ResetAuthenticationReq() {
    }

    @Override
    public MsgConfig conf() {
        return MsgIdGuild.RESET_AUTHENTICATION_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        if (!cc.getRole().getRes().guild.checkGuild().ok()) {
            game.notice.message(cc.getRole(), 310450, "尚未加入公会");
            return;
        }
        Role role = cc.getRole();
        role.getRes()
                .guild
                .getGuild()
                .basic
                .changeAuthentication(role, authentication, levelRequired, PowerRequired);
    }
}
